<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>测试MLquery库</title>
</head>
<body>
	<div id="wrap" style="width: 50%;height: 100px;margin:300px auto;background-color: green;">
		<p id="content_p">111</p>
	</div>
	<script type="text/javascript" src="./MLquery.js"></script>
	<script>
		// 1.统计字符数
		let countStr=MLquery.countStr('不合适吧出黑色的翅膀才不得车');
		console.log(countStr)
		// 2.给钱加千位分隔符
		let moneyFormat=MLquery.moneyFormat(87888.77);
		console.log(moneyFormat)
		// 3.验证邮箱正确性
		console.log(MLquery.checkMail('1234@baidu.com'))
		// 4.验证深拷贝
		let obj1 ={
			name:'zhangsan',
			age:20
		}

		let obj2 = MLquery.deepClone(obj1);
		obj1.age =99;
		console.log(obj2,obj1)
		//5.实现驼峰写法的转换方法
		console.log(MLquery.nameFormat('font-size'));
		// 6.格式化时间
		console.log(MLquery.dateFormat(new Date(),'XXXX-MM-DD hh-mm-ss day'));
		// 7.8 测试封装的ajax和延时方法
		let option ={
			type:'get',
			url:'https://v0.yiketianqi.com/api',
			data:{
				version:'v61',
				appid:'69843683',
				appsecret:'rzyYj9jH',
				city:'丽水'
			},
			header:{
				'content-type':'application/json'
			}
		}
		MLquery.reqDelayAjax(option,1000).then(result=>{
			console.log(result)
			},err=>{
				console.log(err)
			});
		// 9.计时进度条
		var option2={
			seconds:100,
			style:{
				width:'400px',
				height:'10px',
				wapBgcolor:'#f3f4f6',
				Bgcolor:'#999',
				position:'absolute',
				left:'100px',
				top:'100px',
				borderRadius:'10px'
			}
		}
		MLquery.progressBar(option2,function(){
			// window.location.href = 'http://www.baidu.com'
		})

		// 10.节点操作相关
		var fn = function(){alert("11")}
		MLquery.setCss('wrap','text-align','center').setCss('wrap','color','red').setAttr('content_p','ClassName','hello').bindEvent('wrap','click',fn)
		console.log(MLquery)
		// 11.测试数组去重复的方法
		let resultArr = MLquery.removeAgain([1,1,'hello','hello',{},{},NaN,]);
		console.log(resultArr)
	</script>
</body>
</html>
